package com.drophair.jspwork.Servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "DetailServlet", value = "/DetailServlet")
public class DetailServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        super.doPost(request,response);
        String goodid="";
        goodid=request.getParameter("goodid");
        String goodname="";
        goodname=request.getParameter("goodname");
        String goodprice="";
        goodprice=request.getParameter("goodprice");
        System.out.println("doGet+++++GOODID是："+goodid);
        request.setAttribute("goodid",goodid);
        request.setAttribute("goodname",goodname);
        request.setAttribute("goodprice",goodprice);
        request.getRequestDispatcher("/common/details.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        super.doGet(request,response);
        String goodid="";
        goodid=request.getParameter("goodid");
        System.out.println("doPost+++++GOODID是："+goodid);
    }
}
